// import * as directives from './directives'
import * as filters from './filters'
const context = require.context('./components', true, /\.vue$/)
const components = context.keys().map((key) => context(key).default)
// console.log(components)
export default {
  install(Vue) {
    components.forEach((ele) => {
      Vue.component(ele.name, ele)
    })
    // Object.keys(directives).forEach((key) => {
    //   Vue.directive(key, directives[key])
    // })
    Object.keys(filters).forEach((ele) => {
      // Vue.filter(过滤器名称, 过滤器回调函数)
      Vue.filter(ele, filters[ele])
    })
  }
}
